import request from '../utils/request'

// 库存相关API接口

export const inventoryApi = {
  // 获取库存列表
  getInventoryList: (params) => request.get('/inventory/list', { params }),
  
  // 获取商品库存
  getProductInventory: (productId) => request.get(`/inventory/product/${productId}`),
  
  // 更新库存
  updateInventory: (productId, quantity) => request.put(`/inventory/product/${productId}`, { quantity }),
  
  // 批量更新库存
  batchUpdateInventory: (data) => request.put('/inventory/batch-update', data),
  
  // 库存盘点
  checkInventory: (params) => request.post('/inventory/check', params),
  
  // 获取库存预警列表
  getInventoryWarningList: () => request.get('/inventory/warning/list'),
  
  // 库存流水记录
  getInventoryLogList: (params) => request.get('/inventory/log/list', { params }),
  
  // 导出库存数据
  exportInventoryData: (params) => request.get('/inventory/export', { params, responseType: 'blob' })
}

export default inventoryApi